<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@page import="com.solution.admin.order.constants.OrderConstants"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>我的订单</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta content="zh-cn" http-equiv="content-language" />
<meta content="" name="copyright" />
<%@ include file="/page/pc/include.jsp"%>

<!--[if lte IE 6]> 
<script type="text/javascript" src="js/PNG.js"></script> 
<script> 
PNG.fix('*'); 
</script> 
<![endif]-->
<script type="text/javascript">
	//系统域名 
	var rootPath = '<%=basePath%>';
	// 系统上传文件展示域名
	var imgRootURL = '<%=imgRootURL%>';
</script>
</head>
<body style="background: #f5f5f5">
	<c:set var="orderStatusFinished" value="<%=OrderConstants.ORDER_STATUS.FINISHED.getCode() %>"></c:set>
	
	<div class="wrap">
		<!---头部公共部分开始-->
		<div class="header">
			<jsp:include page="../header_top.jsp" />
		</div>
		<div class="member_header">
			<div class="member_header_con">
				<h1>
					<a href="${rootPath}/pc/index"><img src="${rootPath}/statics/images/logo5.png" /></a>
				</h1>
				<div class="member_nav">
					<ul>
						<li><a class="a1" href="${rootPath}/pc/index">首页</a></li>
						<li onmouseover="this.className='hover'"
							onMouseOut="this.className=''"><a href="javascript:void(0)" class="a1">账户管理<i></i></a>
							<dl>
								<dd>
									<p>
										<span>账户管理</span><i></i>
									</p>
								</dd>
								<dt>
									<a href="<%=basePath%>/pc/my"><p>我的信息</p></a>
								</dt>
								<dt>
									<a href="<%=basePath%>/pc/my/mypwd"><p>修改密码</p></a>
								</dt>
								<dt>
									<a href="<%=basePath%>/pc/my/address"><p>收货地址</p></a>
								</dt>
							</dl></li>
					</ul>
				</div>
				<div class="member_header_right">
					<div class="search_part11">
						<form action="${rootPath}/pc/product/search" method="post">
							<input type="text" name="searchKey" class="inputstyle11" /> 
							<input type="submit" class="inputbtn11" value="搜索" />
						</form>
					</div>
					<div class="cart_part1">
						<p>
							<a href="${rootPath}/pc/shoppingcart/list" target="_blank"><i></i><span>我的购物车</span><em id="shopCount">0</em></a>
						</p>
					</div>
				</div>
			</div>
		</div>
	</div>
	</div>
	<!---头部公共部分结束-->
	<div class="site_wrap120">
		<div class="site_wrap120_con">
			<div class="pathinfo2">
				<p>
					<a href="${rootPath}/pc/order/list">订单中心</a><span>&gt;</span><em>订单号：${order.orderCode }</em>
				</p>
			</div>
			<div class="dd_info1">
				<div class="dd_info1_con">
					<div class="dd_info1_1">
						<div class="box18">
							<h2>订单号：${order.orderCode }</h2>
							<h1>${order.orderStatusName}</h1>
							<div style="margin:30px;text-align: left;line-height: 20px;color:red;">
							<c:if test="${order.orderStatus == '03' && order.approveReason != null && order.approveReason != ''}">
								<span>审核不通过原因：${order.approveReason }</span>
							</c:if>
							</div>
							<c:if test="${order.orderStatus eq orderStatusFinished && order.appraiseFlag ne 1}">
								<h3>
									<a href="${rootPath }/pc/evaluation/toOrderEvaluation?orderCode=${order.orderCode }">评价</a>
								</h3>
							</c:if>
						</div>
					</div>
					<div class="dd_info1_2">
						<div class="step_list">
							<s></s><u></u>
							<ul>
								<li>
									<p>
										<i class="icon1"></i> <span>提交订单</span>
									</p>
								</li>
								<li  ${order.orderStatus == "01"? "class='current'" : '' }>
									<p>
										<i class="icon2"></i> <span>待付款</span>
									</p>
								</li>
								<li ${order.orderStatus == "04"? "class='current'" : '' }>
									<p>
										<i class="icon3"></i> <span>待发货</span>
									</p>
								</li>
								<li ${order.orderStatus == "05"? "class='current'" : '' }><p>
										<i class="icon4"></i> <span>待收货</span>
									</p></li>
								<li ${order.orderStatus == "07"? "class='current'" : '' }>
									<p>
										<i class="icon5"></i> <span>完成</span>
									</p>
								</li>
							</ul>
						</div>
					</div>
				</div>
			</div>
			<div class="dd_info2">
				<div class="dd_info2_con">
					<ul>
						<li><s></s>
							<dl>
								<dt>
									<strong>收货人：</strong>
									<div class="txt1">${order.receiverName }</div>
								</dt>
								<dt>
									<strong>地址：</strong>
									<div class="txt1">${order.provinceName}${order.cityName}${order.areaName}${order.streetName}${order.address}</div>
								</dt>
								<dt>
									<strong>手机号码：</strong>
									<div class="txt1">${order.receiverMobile }</div>
								</dt>
							</dl></li>
						<li><s></s>
							<dl>
								<dt>
									<strong>配送方式：</strong>
									<div class="txt1">${order.deliveryTypeName }</div>
								</dt>
								
								<c:forEach items="${deliveredList }" var="delivery">
								<dt>
				            		<strong>物流公司：</strong><div class="txt1">${delivery.deliveryCompanyName } ${delivery.deliveryCode }</div>
				            	</dt>
								</c:forEach>
								
								<dt>
									<strong>运费：</strong>
									<div class="txt1">¥${order.deliveryFeeMoney }</div>
								</dt>
								<dt>
									<strong>运费支付：</strong>
									<div class="txt1">${order.deliveryFeePayTypeName }</div>
								</dt>
							</dl></li>
						<li><s></s>
							<dl>
								<dt>
									<strong>付款方式：</strong>
									<div class="txt1">
										<c:if test="${order.payStatus eq '01' }">
											未支付
										</c:if>
										<c:if test="${order.payStatus ne '01' }">
											${order.payTypeName }
										</c:if>
									</div>
								</dt>
								<dt>
									<strong>付款时间：</strong>
									<div class="txt1">
										<c:if test="${order.payTime == null }">
											<span>尚未支付</span>
										</c:if>
										<c:if test="${order.payTime != null }">
											<fmt:formatDate value="${order.payTime}" pattern="yyyy-MM-dd:HH:mm:ss"/>
										</c:if>
									</div>
								</dt>
								<dt>
									<strong>应付总额：</strong>
									<div class="txt1">¥<fmt:formatNumber type="number" value="${order.realPayMoney}" pattern="0.00" /></div>
								</dt>
							</dl></li>
						<li>
							<dl>
								<dt>
									<strong>发票类型：</strong>
									<div class="txt1">
										<c:if test="${order.invoiceType == '01'}">
											不开发票
										</c:if>
										<c:if test="${order.invoiceType == '02'}">
											普通发票
										</c:if>
										<c:if test="${order.invoiceType == '03'}">
											增值税发票
										</c:if>
									</div>
								</dt>
								<c:if test="${order.invoiceType == '02' }">
									<dt>
										<strong>公司发票抬头：</strong>
										<div class="txt1">${invoice.compnayName }</div>
									</dt>
									<dt>
										<strong>纳税人识别码：</strong>
										<div class="txt1">${invoice.taxNo}</div>
									</dt>
								</c:if>
								<c:if test="${order.invoiceType == '03' }">
									<dt>
										<strong>单位名称：</strong>
										<div class="txt1">${invoice.compnayName}</div>
									</dt>
									<dt>
										<strong>纳税人识别码：</strong>
										<div class="txt1">${invoice.taxNo}</div>
									</dt>
									<dt>
										<strong>注册地址：</strong>
										<div class="txt1">${invoice.registeAddress}</div>
									</dt>
									<dt>
										<strong>注册电话：</strong>
										<div class="txt1">${invoice.registePhone}</div>
									</dt>
									<dt>
										<strong>开户银行：</strong>
										<div class="txt1">${invoice.openBankName}</div>
									</dt>
									<dt>
										<strong>银行账户：</strong>
										<div class="txt1">${invoice.bankAccount}</div>
									</dt>
								</c:if>
							</dl>
						</li>
					</ul>
				</div>
			</div>
			<div class="dd_info3">
				<table>
					<thead>
						<tr>
							<td style="width: 534px;">商品</td>
							<td>商品单价</td>
							<td>商品编号</td>
							<td>商品数量</td>
						</tr>
					</thead>
					<tbody>
						<c:forEach items="${productList }" var="product">
						<tr>
							<td style="text-align: left">
								<div class="mypic10">
									<div class="pic">
										<img src="${imgRootURL}${product.imagePath}" />
									</div>
									<div class="item-info">
										<h2>${product.productName }</h2>
										<span style="line-height:25px;font-size:12px;">
											<c:forEach items="${product.productSpecList }" var="spec">
												${spec.specName }：${spec.specValue}<br/>
											</c:forEach>
										</span>
									</div>
								</div>
							</td>
							<td>¥<fmt:formatNumber type="number" value="${product.productAdjustPrice }" pattern="0.00" /></td>
							<td>${product.productCode }</td>
							<td>x${product.buyNum}</td>
						</tr>
						</c:forEach>
						
						<tr>
							<td colspan="4" style="text-align: right">
								<div class="total_part3">
									<dl>
										<dt>
											<strong>商品总金额：</strong>
											<p>¥<fmt:formatNumber type="number" value="${totalProductMoneyAfterAdjust}" pattern="0.00" /></p>
										</dt>
										<dt>
											<strong>优惠券抵扣金额：</strong>
											<p>-¥<fmt:formatNumber type="number" value="${order.couponMoney}" pattern="0.00" /></p>
										</dt>
										<dt>
											<strong>积分抵扣金额：</strong>
											<p>-¥<fmt:formatNumber type="number" value="${order.pointsMoney}" pattern="0.00" /></p>
										</dt>
										<dt>
											<strong>订单促销优惠：</strong>
											<p>-¥<fmt:formatNumber type="number" value="${order.promotionDiscountMoney}" pattern="0.00" /></p>
										</dt>
										<dt>
											<strong>订单总额调整：</strong>
											<p>
												<c:if test="${order.adjustOrderMoney < 0 }">
													-¥<fmt:formatNumber type="number" value="${order.adjustOrderMoney * -1}" pattern="0.00" />
												</c:if>
												<c:if test="${order.adjustOrderMoney >= 0 }">
													¥<fmt:formatNumber type="number" value="${order.adjustOrderMoney}" pattern="0.00" />
												</c:if>
											</p>
										</dt>
										<dt>
											<strong>运&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;费：</strong>
											<p>
												<c:if test="${order.deliveryFeeMoney < 0 }">
													-¥<fmt:formatNumber type="number" value="${order.deliveryFeeMoney * -1}" pattern="0.00" />
												</c:if>
												<c:if test="${order.deliveryFeeMoney >= 0 }">
													¥<fmt:formatNumber type="number" value="${order.deliveryFeeMoney}" pattern="0.00" />
												</c:if>
											</p>
										</dt>
										<dt class="a1">
											<strong><b>应&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;付：</b></strong>
											<p>
												<b>¥<fmt:formatNumber type="number" value="${order.realPayMoney}" pattern="0.00" /></b>
											</p>
										</dt>

									</dl>
								</div>
							</td>
						</tr>
					</tbody>
				</table>
			</div>
		</div>
	</div>
	<div>
		<!---网站底部开始-->
		<jsp:include page="../footer.jsp?showQaFlag=0" />
		<!---网站底部结束-->
	</div>

	<script charset="utf-8" language="javascript" type="text/javascript" src="${rootPath}/statics/js/jquery.1.11.3.min.js"></script>
<script type="text/javascript">
$(function() {
		/**
		 * 获取购物车数量
		 */
		$.ajax({
			type: 'POST',
			url: rootPath + "/pc/shoppingcart/getShoppingcarCount",
			async: true,
			dataType: 'json',
			success: function(json) {
				if(json.code == '1') {
					$("#shopCount").html(json.data);
				}
			}
		});
	});
	</script>
</body>
</html>